<?php
include("dbcon.php");
$result=mysql_query("select * from polling");

$row=mysql_fetch_array($result);
//$gettotal = mysql_num_rows($result);

$gettotal = $row['dislike'] + $row['liked'];

$dislike=$row['dislike'];

$like=$row['liked'];

$average=$row['average'];

$likes=($like*30)/$gettotal;
$average=($average*30)/$gettotal;
$dislikes=($dislike*30)/$gettotal;?>

<button type="button" class="totalstatsbutton" onclick=";return false;" >
<div class="greenBar" style="width:<?php echo $likes?>px">&nbsp;</div>
<div class="redbar" style="width:<?php echo $dislikes?>px">&nbsp;</div>
<div class="bluebar" style="width:<?php echo $average?>px">&nbsp;</div>
</button>

